package com.cj.bigfileupload.service;

import com.cj.bigfileupload.controller.request.MultipartFileParam;

import java.io.IOException;

/**
 * ClassName: IWebUploadService <br/>
 * Function: 文件上传service接口 <br/>
 * date: 2018/05/08 15:42 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public interface IWebUploadService {

    /**
     * 上传文件，效率高，但存在内存占用大和文件关闭等不确定问题
     * 处理文件分块，基于MappedByteBuffer来实现文件的保存
     *
     * @param uploadDirPath 上传目录路径
     * @param param
     * @return
     * @throws IOException
     */
    boolean uploadFileByMappedByteBuffer(String uploadDirPath, MultipartFileParam param) throws IOException;

    /**
     * 上传文件方法
     *
     * @param param
     * @throws IOException
     */
    boolean uploadFileRandomAccessFile(String uploadDirPath, MultipartFileParam param) throws IOException;
}
